import sys
import os
import profile
cur_file_path, filename = os.path.split(os.path.abspath(__file__))
sys.path.append(f"{cur_file_path}/../")

from l0n0lnet.reverse import reverse_server, reverse_client
from l0n0lnet.stream_parser import stream_parser
from l0n0lnet import run, add_quit_func
from l0n0lnet.commands import get_keys

# keys = [
#     stream_parser.gen_password(),
#     stream_parser.gen_password()
# ]

keys = get_keys("C:\\softs\\代理\\pass.txt")

ss = reverse_server(b'0.0.0.0', 12345, keys)

sc = reverse_client(b"127.0.0.1", 12345, keys, 8080, b'127.0.0.1', 80)
# sc = reverse_client(b"45.195.8.49", 1001, keys, 80, b'127.0.0.1', 80)


def on_close():
    ss.close()
    sc.close()
    print("quit")


add_quit_func(on_close)

run()
# profile.run("run()")